package marmalius;

public class Fletching {
    public int Del = 0;
    private int xprate = 2; // this means the received xp is multiplied by this number
    public String logtobowID;
    public String type[] = { "normal", "oak", "willow", "maple", "yew", "magic"};
    public String type2;

    public void stringbow(int useditem, int usedwith, int playerId) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);
        int bowId = 0;

        if (useditem == 1777) {
            bowId = usedwith;
        } else if (usedwith == 1777) {
            bowId = useditem;
        }
        Del = bowId;
        switch (bowId) {
        case 48: // longbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(839, 1);
            break;

        case 50: // shortbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(841, 1);
            break;

        case 56: // oak longbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(845, 1);
            break;

        case 54: // oak shortbowbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(843, 1);
            break;

        case 58: // willow longbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(847, 1);
            break;

        case 60: // willow shortbowbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(849, 1);
            break;

        case 62: // maple longbowbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(851, 1);
            break;

        case 64: // maple shortbowbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(853, 1);
            break;

        case 66: // yew longbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(855, 1);
            break;

        case 68: // yew shortbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(857, 1);
            break;

        case 70: // magic longbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(859, 1);
            break;

        case 72: // magic shortbow (u)
            c.sendMessage("You attach the bowstring to the bow.");
            c.deleteItem(Del, c.getItemSlot(Del), 1);
            c.addSkillXP(c.playerLevel[9] * xprate, 9);
            c.deleteItem(1777, c.getItemSlot(1777), 1);
            c.addItem(861, 1);
            break;
        }
    }

    public void feathertoshaft(int itemused, int usewith, int playerId) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);
        int randommiss = misc.random(20);

        if (c.playerItemsN[c.GetItemSlot(itemused)] >= 30
                && c.playerItemsN[c.GetItemSlot(usewith)] >= 30) {
            c.deleteItem(itemused, c.GetItemSlot(itemused), 30);
            c.deleteItem(usewith, c.GetItemSlot(usewith), 30);
            c.addItem(53, 10 + randommiss);
            c.addSkillXP((10 + randommiss) * xprate, 9);
            c.sendMessage("You attach the feathers to the arrow shafts.");
            c.sendMessage(
                    "You succesfully made " + (10 + randommiss)
                    + " headless arrows.");
        } else {
            c.sendMessage(
                    "You need atleast 30 feathers and arrowshafts for this action");
        }
    }

    public void tiptoarrow(int itemused, int usewith, int playerId) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);
        int tipID = 0;
        int harrow = 0;

        if (itemused == 53) {
            tipID = usewith;
            harrow = itemused;
        }
        if (usewith == 53) {
            tipID = itemused;
            harrow = usewith;
        }
        if (c.playerItemsN[c.GetItemSlot(53)] >= 30) {
            if (tipID == 39 && c.playerItemsN[c.GetItemSlot(tipID)] >= 30) {
                if (c.playerLevel[9] > 0) {
                    c.deleteItem(tipID, c.GetItemSlot(tipID), 30);
                    c.deleteItem(harrow, c.GetItemSlot(harrow), 30);
                    c.addItem(882, 30);
                    c.addSkillXP(30 * 2 * xprate, 9);
                    c.sendMessage(
                            "You attached the arrowheads to the headless arrows.");
                } else {
                    c.sendMessage(
                            "You need a higher fletching level to do this.");
                }
            }
            if (tipID == 40 && c.playerItemsN[c.GetItemSlot(tipID)] >= 30) {
                if (c.playerLevel[9] > 14) {
                    c.deleteItem(tipID, c.GetItemSlot(tipID), 30);
                    c.deleteItem(harrow, c.GetItemSlot(harrow), 30);
                    c.addItem(884, 30);
                    c.addSkillXP(30 * 4 * xprate, 9);
                    c.sendMessage(
                            "You attached the arrowheads to the headless arrows.");
                } else {
                    c.sendMessage(
                            "You need a higher fletching level to do this.");
                }
            }
            if (tipID == 41 && c.playerItemsN[c.GetItemSlot(tipID)] >= 30) {
                if (c.playerLevel[9] > 29) {
                    c.deleteItem(tipID, c.GetItemSlot(tipID), 30);
                    c.deleteItem(harrow, c.GetItemSlot(harrow), 30);
                    c.addItem(886, 30);
                    c.addSkillXP(30 * 6 * xprate, 9);
                    c.sendMessage(
                            "You attached the arrowheads to the headless arrows.");
                } else {
                    c.sendMessage(
                            "You need a higher fletching level to do this.");
                }
            }
            if (tipID == 42 && c.playerItemsN[c.GetItemSlot(tipID)] >= 30) {
                if (c.playerLevel[9] > 44) {
                    c.deleteItem(tipID, c.GetItemSlot(tipID), 30);
                    c.deleteItem(harrow, c.GetItemSlot(harrow), 30);
                    c.addItem(888, 30);
                    c.addSkillXP(30 * 12 * xprate, 9);
                    c.sendMessage(
                            "You attached the arrowheads to the headless arrows.");
                } else {
                    c.sendMessage(
                            "You need a higher fletching level to do this.");
                }
            }
            if (tipID == 43 && c.playerItemsN[c.GetItemSlot(tipID)] >= 30) {
                if (c.playerLevel[9] > 64) {
                    c.deleteItem(tipID, c.GetItemSlot(tipID), 30);
                    c.deleteItem(harrow, c.GetItemSlot(harrow), 30);
                    c.addItem(890, 30);
                    c.addSkillXP(30 * 16 * xprate, 9);
                    c.sendMessage(
                            "You attached the arrowheads to the headless arrows.");
                } else {
                    c.sendMessage(
                            "You need a higher fletching level to do this.");
                }
            }
            if (tipID == 44 && c.playerItemsN[c.GetItemSlot(tipID)] >= 30) {
                if (c.playerLevel[9] > 74) {
                    c.deleteItem(tipID, c.GetItemSlot(tipID), 30);
                    c.deleteItem(harrow, c.GetItemSlot(harrow), 30);
                    c.addItem(892, 30);
                    c.addSkillXP(30 * 20 * xprate, 9);
                    c.sendMessage(
                            "You attached the arrowheads to the headless arrows.");
                } else {
                    c.sendMessage(
                            "You need a higher fletching level to do this.");
                }
            }
        }
    }

    public void makeshafts(int playerId, int amount) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);

        if (checkamount(playerId, amount, Del)) {
            //FletchingTimer t = 
            new FletchingTimer(playerId, Del, 52, amount, 6 * 30 * amount * xprate);
        } else if (!checkamount(playerId, amount, Del)) {
            c.sendMessage(
                    "You dont have enough logs to make " + amount * 30
                    + " arrow shafts.");
        }
    }

    public void deleteitemextra(int playerId, int itemid, int amount) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);

        if (amount != 0) {
            for (int i = 0; i < amount; i++) {
                c.deleteItem(itemid, c.getItemSlot(itemid), 1);
            }
        }
    }

    public void additemextra(int playerId, int itemid, int amount) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);

        if (amount != 0) {
            for (int i = 0; i < amount; i++) {
                c.addItem(itemid, 1);
            }
        }
    }

    public boolean checkamount(int playerId, int amount, int itemId) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);
        //int realamount = 0;
        
        return c.getInventory().getTotalSlot(itemId) >= amount;
        /*
        for (int i = 0; i < 28; i++) {
            if (c.playerItems[i] - 1 == itemId) {
                realamount++;
            }
            if (realamount >= amount) {
                return true;
            }
        }
        
        return false;
        */
    }

    public int checkamnt(int itemId, int playerId) {
       // int realamnt = 0;
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);
        
        return c.getInventory().getTotalSlot(itemId);
        /*
        for (int i = 0; i < 28; i++) {
            if (c.playerItems[i] - 1 == itemId) {
                realamnt++;
            }
        }
        return realamnt;
        */
    }
    public boolean isfletching;
    public void logstobow(int useditem, int usedwith, int playerId) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);
        int logId = 0;

        isfletching = true;
        if (useditem == 946)
            logId = usedwith;
        else if (usedwith == 946)
            logId = useditem;
        Del = logId;
        switch (logId) {
        case 1511: // normal logs
            c.RemoveAllWindows();
            c.sendFrame164(8880);
            c.sendFrame246(8883, 250, 50);
            c.sendFrame246(8884, 200, 52);
            c.sendFrame246(81248, 200, 48);
            c.sendFrame126("Longbow(u)", 8897); // most right item pic
            c.sendFrame126("Arrow Shaft (x30)", 8893); // middle item pic
            c.sendFrame126("Shortbow(u)", 8889); // most left item pic
            type2 = type[0];
            Del = logId;
            break;

        case 1521: // oak logs
            c.RemoveAllWindows();
            c.sendFrame164(8880);
            c.sendFrame246(8883, 250, 54);
            c.sendFrame246(8884, 200, -1);
            c.sendFrame246(81248, 200, 56);
            c.sendFrame126("Oak Longbow(u)", 8897); // most right item pic
            c.sendFrame126("", 8893); // middle item pic
            c.sendFrame126("Oak Shortbow(u)", 8889); // most left item pic
            type2 = type[1];
            break;

        case 1519: // willow logs
            c.RemoveAllWindows();
            c.sendFrame164(8880); 
            c.sendFrame246(8883, 250, 60);
            c.sendFrame246(8884, 200, -1);
            c.sendFrame246(81248, 200, 58);
            c.sendFrame126("Willow Longbow(u)", 8897); // most right item pic
            c.sendFrame126("", 8893); // middle item pic
            c.sendFrame126("Willow Shortbow(u)", 8889); // most left item pic
            type2 = type[2];
            break;

        case 1517: // maple logs
            c.RemoveAllWindows();
            c.sendFrame164(8880);
            c.sendFrame246(8883, 250, 64);
            c.sendFrame246(8884, 200, -1);
            c.sendFrame246(81248, 200, 62);
            c.sendFrame126("Maple Longbow(u)", 8897); // most right item pic
            c.sendFrame126("", 8893); // middle item pic
            c.sendFrame126("Maple Shortbow(u)", 8889); // most left item pic
            type2 = type[3];
            break;

        case 1515: // yew logs
            c.RemoveAllWindows();
            c.sendFrame164(8880);
            c.sendFrame246(8883, 250, 68);
            c.sendFrame246(8884, 200, -1);
            c.sendFrame246(81248, 200, 66);
            c.sendFrame126("Yew Longbow(u)", 8897); // most right item pic
            c.sendFrame126("", 8893); // middle item pic
            c.sendFrame126("Yew Shortbow(u)", 8889); // most left item pic
            type2 = type[4];
            break;

        case 1513: // magic logs
            c.RemoveAllWindows();
            c.sendFrame164(8880);
            c.sendFrame246(8883, 250, 72);
            c.sendFrame246(8884, 200, -1);
            c.sendFrame246(81248, 200, 70);
            c.sendFrame126("Magic Longbow(u)", 8897); // most right item pic
            c.sendFrame126("", 8893); // middle item pic
            c.sendFrame126("Magic Shortbow(u)", 8889); // most left item pic
            type2 = type[5];
            break;

        default:
            break;
        }
    }

    public void makebowu(int playerId) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);

        if (logtobowID == "short") {
            if (type2 == "normal") {
                if (c.playerLevel[9] > 0) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " shortbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 50, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(50, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 1 to fletch this.");
                }
            }
            if (type2 == "oak") {
                if (c.playerLevel[9] > 14) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " shortbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 100, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(54, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 15 to fletch this.");
                }
            }
            if (type2 == "willow") {
                if (c.playerLevel[9] > 24) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " shortbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 125, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(60, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 25 to fletch this.");
                }
            }
            if (type2 == "maple") {
                if (c.playerLevel[9] > 44) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " shortbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 150, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(64, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 55 to fletch this.");
                }
            }
            if (type2 == "yew") {
                if (c.playerLevel[9] > 59) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " shortbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 175, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(68, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 60 to fletch this.");
                }
            }
            if (type2 == "magic") {
                if (c.playerLevel[9] > 74) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " shortbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 225, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(72, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 75 to fletch this.");
                }
            }
        }
        if (logtobowID == "long") {
            if (type2 == "normal") {
                if (c.playerLevel[9] > 9) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " longbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 75, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(48, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 10 to fletch this.");
                }
            }
            if (type2 == "oak") {
                if (c.playerLevel[9] > 19) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " longbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 125, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(56, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 20 to fletch this.");
                }
            }
            if (type2 == "willow") {
                if (c.playerLevel[9] > 34) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " longbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 150, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(58, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 35 to fletch this.");
                }
            }
            if (type2 == "maple") {
                if (c.playerLevel[9] > 54) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " longbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 175, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(62, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 55 to fletch this.");
                }
            }
            if (type2 == "yew") {
                if (c.playerLevel[9] > 69) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " longbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 200, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(66, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 70 to fletch this.");
                }
            }
            if (type2 == "magic") {
                if (c.playerLevel[9] > 79) {
                    c.sendMessage(
                            "You fletched a " + type2
                            + " longbow(u) out of the " + type2 + " logs");
                    c.addSkillXP(xprate * 250, 9);
                    c.deleteItem(Del, c.getItemSlot(Del), 1);
                    c.addItem(70, 1);
                    c.startAnimation(1248);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 80 to fletch this.");
                }
            }
        }
    }

    public void makeshortx(int playerId, int amount) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);

        if (checkamount(playerId, amount, Del)) {
            if (type2 == "normal") {
                if (c.playerLevel[9] > 0) {
                	//FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 50, amount, xprate * 50);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 1 to fletch a " + type2
                            + " shortbow(u).");
                }
            }
            if (type2 == "oak") {
                if (c.playerLevel[9] > 14) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 54, amount, xprate * 100);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 15 to fletch a "
                                    + type2 + " shortbow(u).");
                }
            }
            if (type2 == "willow") {
                if (c.playerLevel[9] > 24) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 60, amount, xprate * 125);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 25 to fletch a "
                                    + type2 + " shortbow(u).");
                }
            }
            if (type2 == "maple") {
                if (c.playerLevel[9] > 44) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 64, amount, xprate * 150);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 45 to fletch a "
                                    + type2 + " shortbow(u).");
                }
            }
            if (type2 == "yew") {
                if (c.playerLevel[9] > 59) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 68, amount, xprate * 175);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 60 to fletch a "
                                    + type2 + " shortbow(u).");
                }
            }
            if (type2 == "magic") {
                if (c.playerLevel[9] > 74) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 72, amount, xprate * 225);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 75 to fletch a "
                                    + type2 + " shortbow(u).");
                }
            }
        } else { 
            c.sendMessage(
                    "You dont have enough " + type2 + " logs to fletch "
                    + amount + " " + type2 + " shortbows(u).");
        }
    }

    public void makelongx(int playerId, int amount) {
        client c = (client) PlayerHandler.getInstance().getPlayer(playerId);

        if (checkamount(playerId, amount, Del)) {
            if (type2 == "normal") {
                if (c.playerLevel[9] > 9) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 48, amount, xprate * 75);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 10 to fletch a "
                                    + type2 + " longbow(u).");
                }
            }
            if (type2 == "oak") {
                if (c.playerLevel[9] > 19) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 52, amount, xprate * 125);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 20 to fletch a "
                                    + type2 + " longbow(u).");
                }
            }
            if (type2 == "willow") {
                if (c.playerLevel[9] > 34) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 58, amount, xprate * 150);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 35 to fletch a "
                                    + type2 + " longbow(u).");
                }
            }
            if (type2 == "maple") {
                if (c.playerLevel[9] > 54) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 62, amount, xprate * 175);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 55 to fletch a "
                                    + type2 + " longbow(u).");
                }
            }
            if (type2 == "yew") {
                if (c.playerLevel[9] > 69) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 66, amount, xprate * 200);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 70 to fletch a "
                                    + type2 + " longbow(u).");
                }
            }
            if (type2 == "magic") {
                if (c.playerLevel[9] > 79) {
                    //FletchingTimer t = 
                    new FletchingTimer(playerId, Del, 70, amount, xprate * 250);
                } else {
                    c.sendMessage(
                            "You need a fletching lvl of 80 to fletch a "
                                    + type2 + " longbow(u).");
                }
            }
        } else { 
            c.sendMessage(
                    "You dont have enough " + type2 + " logs to fletch "
                    + amount + " " + type2 + " longbows(u).");
        }
    }

}

